.class public Lcom/ninesky/browser/setting/BasePreference;
.super Landroid/preference/Preference;


# instance fields
.field protected a:Landroid/widget/TextView;

.field protected b:Landroid/widget/TextView;

.field protected c:I

.field protected d:I

.field protected e:I

.field private final f:Z

.field private g:I

.field private h:I

.field private i:I

.field private j:Landroid/widget/RelativeLayout;

.field private k:Landroid/widget/LinearLayout;


# direct methods
.method public constructor <init>(Landroid/content/Context;Landroid/util/AttributeSet;)V
    .locals 1

    const/4 v0, 0x0

    invoke-direct {p0, p1, p2, v0}, Lcom/ninesky/browser/setting/BasePreference;-><init>(Landroid/content/Context;Landroid/util/AttributeSet;I)V

    return-void
.end method

.method public constructor <init>(Landroid/content/Context;Landroid/util/AttributeSet;I)V
    .locals 5

    const/4 v4, 0x0

    invoke-direct {p0, p1, p2, p3}, Landroid/preference/Preference;-><init>(Landroid/content/Context;Landroid/util/AttributeSet;I)V

    iput-boolean v4, p0, Lcom/ninesky/browser/setting/BasePreference;->f:Z

    const/16 v0, 0x12

    iput v0, p0, Lcom/ninesky/browser/setting/BasePreference;->c:I

    const/16 v0, 0xe

    iput v0, p0, Lcom/ninesky/browser/setting/BasePreference;->d:I

    iput v4, p0, Lcom/ninesky/browser/setting/BasePreference;->e:I

    iput v4, p0, Lcom/ninesky/browser/setting/BasePreference;->i:I

    sget-object v0, Lcom/ninesky/browser/bv;->a:[I

    invoke-virtual {p1, p2, v0, p3, v4}, Landroid/content/Context;->obtainStyledAttributes(Landroid/util/AttributeSet;[III)Landroid/content/res/TypedArray;

    move-result-object v0

    invoke-virtual {v0}, Landroid/content/res/TypedArray;->getIndexCount()I

    move-result v1

    move v2, v4

    :goto_0
    if-lt v2, v1, :cond_0

    invoke-virtual {v0}, Landroid/content/res/TypedArray;->recycle()V

    return-void

    :cond_0
    invoke-virtual {v0, v2}, Landroid/content/res/TypedArray;->getIndex(I)I

    move-result v3

    packed-switch v3, :pswitch_data_0

    :goto_1
    add-int/lit8 v2, v2, 0x1

    goto :goto_0

    :pswitch_0
    invoke-virtual {v0, v4, v4}, Landroid/content/res/TypedArray;->getResourceId(II)I

    move-result v3

    iput v3, p0, Lcom/ninesky/browser/setting/BasePreference;->g:I

    goto :goto_1

    :pswitch_1
    const/4 v3, 0x1

    invoke-virtual {v0, v3, v4}, Landroid/content/res/TypedArray;->getResourceId(II)I

    move-result v3

    iput v3, p0, Lcom/ninesky/browser/setting/BasePreference;->h:I

    goto :goto_1

    :pswitch_data_0
    .packed-switch 0x0
        :pswitch_0
        :pswitch_1
    .end packed-switch
.end method


# virtual methods
.method public final a(I)V
    .locals 1

    iput p1, p0, Lcom/ninesky/browser/setting/BasePreference;->h:I

    iget-object v0, p0, Lcom/ninesky/browser/setting/BasePreference;->k:Landroid/widget/LinearLayout;

    if-eqz v0, :cond_0

    iget-object v0, p0, Lcom/ninesky/browser/setting/BasePreference;->k:Landroid/widget/LinearLayout;

    invoke-virtual {v0, p1}, Landroid/widget/LinearLayout;->setBackgroundResource(I)V

    :cond_0
    return-void
.end method

.method protected callChangeListener(Ljava/lang/Object;)Z
    .locals 4

    invoke-virtual {p0}, Lcom/ninesky/browser/setting/BasePreference;->getContext()Landroid/content/Context;

    move-result-object v0

    const-string v1, "Setting"

    new-instance v2, Ljava/lang/StringBuilder;

    invoke-virtual {p0}, Lcom/ninesky/browser/setting/BasePreference;->getKey()Ljava/lang/String;

    move-result-object v3

    invoke-static {v3}, Ljava/lang/String;->valueOf(Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v3

    invoke-direct {v2, v3}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    const-string v3, ":"

    invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v2

    invoke-virtual {p1}, Ljava/lang/Object;->toString()Ljava/lang/String;

    move-result-object v3

    invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v2

    invoke-virtual {v2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v2

    invoke-static {v0, v1, v2}, Lcom/mobclick/android/c;->a(Landroid/content/Context;Ljava/lang/String;Ljava/lang/String;)V

    invoke-super {p0, p1}, Landroid/preference/Preference;->callChangeListener(Ljava/lang/Object;)Z

    move-result v0

    return v0
.end method

.method protected onBindView(Landroid/view/View;)V
    .locals 4

    const/16 v2, 0x8

    const/4 v3, 0x2

    const v0, 0x1020006

    invoke-virtual {p1, v0}, Landroid/view/View;->findViewById(I)Landroid/view/View;

    move-result-object v0

    check-cast v0, Landroid/widget/ImageView;

    iget v1, p0, Lcom/ninesky/browser/setting/BasePreference;->g:I

    invoke-virtual {v0, v1}, Landroid/widget/ImageView;->setBackgroundResource(I)V

    const v0, 0x1020016

    invoke-virtual {p1, v0}, Landroid/view/View;->findViewById(I)Landroid/view/View;

    move-result-object v0

    check-cast v0, Landroid/widget/TextView;

    iput-object v0, p0, Lcom/ninesky/browser/setting/BasePreference;->a:Landroid/widget/TextView;

    iget-object v0, p0, Lcom/ninesky/browser/setting/BasePreference;->a:Landroid/widget/TextView;

    invoke-virtual {p0}, Lcom/ninesky/browser/setting/BasePreference;->getTitle()Ljava/lang/CharSequence;

    move-result-object v1

    invoke-virtual {v0, v1}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequence;)V

    const v0, 0x1020010

    invoke-virtual {p1, v0}, Landroid/view/View;->findViewById(I)Landroid/view/View;

    move-result-object v0

    check-cast v0, Landroid/widget/TextView;

    iput-object v0, p0, Lcom/ninesky/browser/setting/BasePreference;->b:Landroid/widget/TextView;

    invoke-virtual {p0}, Lcom/ninesky/browser/setting/BasePreference;->getSummary()Ljava/lang/CharSequence;

    move-result-object v0

    invoke-static {v0}, Landroid/text/TextUtils;->isEmpty(Ljava/lang/CharSequence;)Z

    move-result v0

    if-eqz v0, :cond_1

    iget-object v0, p0, Lcom/ninesky/browser/setting/BasePreference;->b:Landroid/widget/TextView;

    invoke-virtual {v0}, Landroid/widget/TextView;->getVisibility()I

    move-result v0

    if-eq v0, v2, :cond_0

    iget-object v0, p0, Lcom/ninesky/browser/setting/BasePreference;->b:Landroid/widget/TextView;

    invoke-virtual {v0, v2}, Landroid/widget/TextView;->setVisibility(I)V

    :cond_0
    :goto_0
    iget-object v0, p0, Lcom/ninesky/browser/setting/BasePreference;->b:Landroid/widget/TextView;

    invoke-virtual {v0}, Landroid/widget/TextView;->getLayoutParams()Landroid/view/ViewGroup$LayoutParams;

    move-result-object v0

    check-cast v0, Landroid/widget/RelativeLayout$LayoutParams;

    invoke-virtual {p0}, Lcom/ninesky/browser/setting/BasePreference;->getContext()Landroid/content/Context;

    move-result-object v1

    iget v2, p0, Lcom/ninesky/browser/setting/BasePreference;->i:I

    int-to-float v2, v2

    invoke-static {v1, v2}, Lcom/ninesky/a/c;->a(Landroid/content/Context;F)I

    move-result v1

    iput v1, v0, Landroid/widget/RelativeLayout$LayoutParams;->leftMargin:I

    iget-object v0, p0, Lcom/ninesky/browser/setting/BasePreference;->a:Landroid/widget/TextView;

    iget v1, p0, Lcom/ninesky/browser/setting/BasePreference;->c:I

    int-to-float v1, v1

    invoke-virtual {v0, v3, v1}, Landroid/widget/TextView;->setTextSize(IF)V

    iget-object v0, p0, Lcom/ninesky/browser/setting/BasePreference;->b:Landroid/widget/TextView;

    iget v1, p0, Lcom/ninesky/browser/setting/BasePreference;->d:I

    int-to-float v1, v1

    invoke-virtual {v0, v3, v1}, Landroid/widget/TextView;->setTextSize(IF)V

    const v0, 0x7f0c003d

    invoke-virtual {p1, v0}, Landroid/view/View;->findViewById(I)Landroid/view/View;

    move-result-object v0

    check-cast v0, Landroid/widget/RelativeLayout;

    iput-object v0, p0, Lcom/ninesky/browser/setting/BasePreference;->j:Landroid/widget/RelativeLayout;

    iget-object v0, p0, Lcom/ninesky/browser/setting/BasePreference;->j:Landroid/widget/RelativeLayout;

    invoke-virtual {v0}, Landroid/widget/RelativeLayout;->getLayoutParams()Landroid/view/ViewGroup$LayoutParams;

    move-result-object v0

    check-cast v0, Landroid/widget/LinearLayout$LayoutParams;

    invoke-virtual {p0}, Lcom/ninesky/browser/setting/BasePreference;->getContext()Landroid/content/Context;

    move-result-object v1

    iget v2, p0, Lcom/ninesky/browser/setting/BasePreference;->e:I

    int-to-float v2, v2

    invoke-static {v1, v2}, Lcom/ninesky/a/c;->a(Landroid/content/Context;F)I

    move-result v1

    iput v1, v0, Landroid/widget/LinearLayout$LayoutParams;->leftMargin:I

    iget v0, p0, Lcom/ninesky/browser/setting/BasePreference;->h:I

    invoke-virtual {p1, v0}, Landroid/view/View;->setBackgroundResource(I)V

    check-cast p1, Landroid/widget/LinearLayout;

    iput-object p1, p0, Lcom/ninesky/browser/setting/BasePreference;->k:Landroid/widget/LinearLayout;

    return-void

    :cond_1
    iget-object v0, p0, Lcom/ninesky/browser/setting/BasePreference;->b:Landroid/widget/TextView;

    invoke-virtual {p0}, Lcom/ninesky/browser/setting/BasePreference;->getSummary()Ljava/lang/CharSequence;

    move-result-object v1

    invoke-virtual {v0, v1}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequence;)V

    iget-object v0, p0, Lcom/ninesky/browser/setting/BasePreference;->b:Landroid/widget/TextView;

    const v1, -0x777778

    invoke-virtual {v0, v1}, Landroid/widget/TextView;->setTextColor(I)V

    goto :goto_0
.end method

.method protected onCreateView(Landroid/view/ViewGroup;)Landroid/view/View;
    .locals 3

    invoke-virtual {p0}, Lcom/ninesky/browser/setting/BasePreference;->getContext()Landroid/content/Context;

    move-result-object v0

    invoke-static {v0}, Landroid/view/LayoutInflater;->from(Landroid/content/Context;)Landroid/view/LayoutInflater;

    move-result-object v0

    const v1, 0x7f030016

    const/4 v2, 0x0

    invoke-virtual {v0, v1, p1, v2}, Landroid/view/LayoutInflater;->inflate(ILandroid/view/ViewGroup;Z)Landroid/view/View;

    move-result-object v0

    return-object v0
.end method
